
add_library(logger SHARED
    logger.cpp
)

# 分离调试符号到.sym文件
add_custom_command(TARGET logger POST_BUILD
    COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $<TARGET_FILE:logger> ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/logger.sym
    COMMAND ${CMAKE_STRIP} --strip-debug --strip-unneeded $<TARGET_FILE:logger>
    COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/logger.sym $<TARGET_FILE:logger>
)